/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.trick.admin.binding;

import javafx.beans.binding.BooleanBinding;
import javafx.scene.control.TextField;

/**
 *
 * @author takahara
 */
public class AddContentsButtonBinding extends BooleanBinding {

    private TextField textField;

    public AddContentsButtonBinding(TextField textField) {
        this.textField = textField;
        super.bind(this.textField.textProperty());
    }

    @Override
    protected boolean computeValue() {

        String tmp = textField.getText().trim();

        if(tmp == null) return true;
        if(tmp.equals("")) return true;

        return false;
    }

}
